home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
-
- <!--
- The contents of this file are subject to the Netscape Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/NPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator client code, released
- March 31, 1998.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corporation. Portions created by Netscape are
- Copyright (C) 1998-1999 Netscape Communications Corporation. All
- Rights Reserved.
-
- Contributor(s):
- -->
-
- <!DOCTYPE window SYSTEM "chrome://wallet/locale/walletTasksOverlay.dtd">
-
- <overlay id="walletTasksOverlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://wallet/content/walletOverlay.js"/>
-
- <script type="application/x-javascript">
- <![CDATA[
-
- function CheckForEncrypt() {
- // remove either encrypt or obscure depending on pref setting
- var elementOn, elementOff;
- var pref;
- pref = Components.classes['@mozilla.org/preferences-service;1'];
- pref = pref.getService();
- pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
- try {
- if (pref.getBoolPref("wallet.crypto")) {
- elementOn = document.getElementById("obscure");
- elementOff = document.getElementById("encrypt");
- } else {
- elementOn = document.getElementById("encrypt");
- elementOff = document.getElementById("obscure");
- }
- elementOn.setAttribute("disabled","false");
- elementOff.setAttribute("disabled","true");
- } catch(e) {
- var encrypt = document.getElementById("encrypt");
- if(encrypt) {
- encrypt.setAttribute("disabled", "true");
- }
- var obscure = document.getElementById("obscure");
- if(obscure) {
- obscure.setAttribute("disabled", "true");
- }
- dump("wallet.crypto pref is missing from all.js\n");
- }
- }
-
- // perform a wallet action
- function WalletAction( action ) {
- var wallet = Components.classes['@mozilla.org/wallet/wallet-service;1'];
- wallet = wallet.getService();
- wallet = wallet.QueryInterface(Components.interfaces.nsIWalletService);
- var strings = document.getElementById("menu_passwordManager");
-
- var pref;
- pref = Components.classes['@mozilla.org/preferences-service;1'];
- pref = pref.getService();
- pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
-
- switch( action ) {
- case "password":
- if (!wallet.WALLET_ChangePassword()) {
- window.alert(strings.getAttribute("PasswordNotChanged"));
- }
- break;
- case "expire":
- if (wallet.WALLET_ExpirePassword()) {
- window.alert(strings.getAttribute("PasswordExpired"));
- } else {
- window.alert(strings.getAttribute("PasswordNotExpired"));
- }
- break;
- case "clear":
-
- var pipNSSBundle = document.getElementById("bundle_pipnss");
- var tokenName = pipNSSBundle.getString("InternalToken");
- window.open("chrome://pippki/content/resetpassword.xul",
- tokenName,
- "centerscreen,chrome,resizable=1,modal=1,dialog=1");
- break;
- case "encrypt":
- if (pref) {
- wallet.WALLET_InitReencryptCallback(window._content);
- pref.setBoolPref("wallet.crypto", true);
- }
- break;
- case "obscure":
- if (pref) {
- wallet.WALLET_InitReencryptCallback(window._content);
- pref.setBoolPref("wallet.crypto", false);
- }
- break;
- /*
- case "safefill":
- formPrefill();
- break;
- case "quickfill":
- formQuickPrefill();
- break;
- case "capture":
- formCapture();
- walletService.WALLET_RequestToCapture(window._content);
- break;
- */
- default:
- break;
- }
- }
- ]]>
- </script>
-
- <!-- tasksOverlay menu items -->
- <menupopup id="taskPopup">
- <menu id="menu_passwordManager"
- insertafter="search"
- label="&walletPasswordManager.label;"
- accesskey="&walletPasswordManager.accesskey;"
- PasswordNotChanged = "&PasswordNotChanged;"
- PasswordExpired = "&PasswordExpired;"
- PasswordNotExpired = "&PasswordNotExpired;">
- <menupopup onpopupshowing="CheckForEncrypt()">
- <menuitem label="&walletDisplaySignonsCmd.label;"
- accesskey="&walletDisplaySignonsCmd.accesskey;"
- oncommand="WalletDialog('signon');"/>
- <menuitem label="&walletChangePasswordCmd.label;"
- accesskey="&walletChangePasswordCmd.accesskey;"
- oncommand="WalletAction('password');"/>
- <menuitem label="&walletExpirePasswordCmd.label;"
- accesskey="&walletExpirePasswordCmd.accesskey;"
- oncommand="WalletAction('expire');"/>
- <menuseparator/>
- <menuitem label="&walletEncryptCmd.label;"
- id="encrypt"
- accesskey="&walletEncryptCmd.accesskey;"
- oncommand="WalletAction('encrypt');"/>
- <menuitem label="&walletObscureCmd.label;"
- id="obscure"
- accesskey="&walletObscureCmd.accesskey;"
- oncommand="WalletAction('obscure');"/>
- <menuitem label="&walletClearCmd.label;"
- id="clear"
- accesskey="&walletClearCmd.accesskey;"
- oncommand="WalletAction('clear');"/>
- </menupopup>
- </menu>
- </menupopup>
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="bundle_pipnss"
- src="chrome://pipnss/locale/pipnss.properties"/>
- </stringbundleset>
-
-
- </overlay>
-